import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

/**
 * Retrieve the token from cookies
 * @returns {string} The token value
 */
export function getToken() {
  return Cookies.get(TokenKey);
}

/**
 * Sets the token in the browser's cookies.
 * @param {string} token - The token to be set.
 */
export function setToken(token) {
  return Cookies.set(TokenKey, token);
}

/**
 * Removes the token from the cookies.
 * 
 * @returns {void}
 */
export function removeToken() {
  // Remove the token from the cookies
  return Cookies.remove(TokenKey);
}
